const {getAll3,deletOne3,addOne3,getOne3,updateOne3} = require('../dao/typesDao');

module.exports.getAll2 = async () =>{
    return await getAll3()
}
module.exports.deletOne2 = async function (typesId){
    const data = await deletOne3(typesId);
    if(data.deletedCount == 1){
        return true;
    }else{
        return false;
    }
}
module.exports.addOne2 = async types =>{
    const data = await addOne3(types);
    return data;
}
//修改  1.获取
module.exports.getOne2 = async _Id =>{
    return await getOne3(_Id);
}
//修改 2.确认修改
module.exports.updateOne2 =async update =>{
    const result =  await updateOne3(update);
    if(result.ok == 1){
        return true;
    }else{
        return false;
    }
    
}